import Vue from 'vue'
// 直接将Vue组件作为Vue.extend的参数
import rankODP from './rankODP';

const showRankODP = (data, config) => {
  let showData = data.showData || null;
  let treeList = data.treeList || null;
  let replaceFields = data.replaceFields || null;
  let multiple = data.multiple || false;
  const choiceTreeConstructor = Vue.extend(rankODP);
  const instance = new choiceTreeConstructor({
    el: document.createElement('div')
  });
  document.querySelector("body").appendChild(instance.$el);
  return instance.show(showData, treeList, replaceFields, multiple, config);
}

export default showRankODP;